﻿using ClientOverflow.DataTransferObjects;
using ClientOverflow.ViewModels.Services;

namespace ClientOverflow.ViewModels.QuestionViewViewModels
{
    /// <summary>
    /// VoteQuestionUpCommand is a command in charge of updating a vote up to a question by a user.
    /// The vote is sent to the server through a WCF service.
    /// </summary>
    public class VoteQuestionUpCommand : VoteQuestionCommandBase
    {
        public VoteQuestionUpCommand(Question question)
            : base(question)
        {
        }

        protected override void Vote(IClientOverflowService serviceClient, User votingUser)
        {
            serviceClient.AddQuestionVoteUp(question, votingUser);
        }
    }
}